<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ page import="org.springside.core.Constants"%>
<%@ page import="cn.firstsoft.firstframe.util.ContextUtils,cn.firstsoft.firstframe.util.Version"%>
<fmt:message key="login_error_code_error" var="login_error_code_error"/>
<fmt:message key="login_error_1" var="login_error_1"/>
<fmt:message key="login_error_2" var="login_error_2"/>
<fmt:message key="login_error_3" var="login_error_3"/>
<fmt:message key="login_error_4" var="login_error_4"/>
<fmt:message key="login_error_5" var="login_error_5"/>
<fmt:message key="login_error_7" var="login_error_7"/>
<fmt:message key="login_error_8" var="login_error_8"/>
<fmt:message key="login_error_9" var="login_error_9"/>

<fmt:message key="login_username" var="login_username"/>
<fmt:message key="login_password" var="login_password"/>
<fmt:message key="login_j_captcha_response" var="login_j_captcha_response"/>
<fmt:message key="login_submit" var="login_submit"/>
<fmt:message key="login_reset" var="login_reset"/>

<fmt:message key="loginjsp_label1" var="loginjsp_label1"/>
<fmt:message key="loginjsp_label2" var="loginjsp_label2"/>
<fmt:message key="loginjsp_label3" var="loginjsp_label3"/>
<fmt:message key="loginjsp_label4" var="loginjsp_label4"/>
<fmt:message key="loginjsp_label5" var="loginjsp_label5"/>
<fmt:message key="loginjsp_label6" var="loginjsp_label6"/>
<fmt:message key="loginjsp_label7" var="loginjsp_label7"/>
<fmt:message key="loginjsp_label8" var="loginjsp_label8"/>
<fmt:message key="loginjsp_label9" var="loginjsp_label9"/>
<fmt:message key="loginjsp_label10" var="loginjsp_label10"/>
<fmt:message key="loginjsp_label11" var="loginjsp_label11"/>
<fmt:message key="loginjsp_label12" var="loginjsp_label12"/>
<fmt:message key="loginjsp_label13" var="loginjsp_label13"/>
<fmt:message key="loginjsp_label14" var="loginjsp_label14"/>
<fmt:message key="loginjsp_label15" var="loginjsp_label15"/>

<%
//session.invalidate();
	String loginTheme =  Constants.DEFAULT_LOGIN_THEME;
	request.setAttribute("loginTheme",loginTheme);
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<style>
<!--
body {
	overflow:auto;
}
#msgOffice a.attractive{color:red;}
-->
</style>
<title><fmt:message key="head.title"/></title>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<script src="<c:url value="/scripts/prototype/prototype.js"/>" type="text/javascript"></script>
<script src="<c:url value="/scripts/prototype/scriptaculous.js"/>" type="text/javascript"></script>
<link rel="shortcut icon" type="image/x-icon" href="<c:url value="/oa.ico"/>">
<link href="<c:url value="/themes/mskin/login/${loginTheme}/style.css"/>" type="text/css" rel=stylesheet>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<SCRIPT language=javascript src="../cookie.js"/>"></SCRIPT>
<script language="javascript" for="document" event="onkeydown">
<!--
//-->
</script>
<script language="vbscript">
	Function str2asc(strstr)
	 	str2asc = hex(asc(strstr))
	End Function
	Function asc2str(ascasc)
	 	asc2str = chr(ascasc)
	End Function
</script>
<script language="javascript">
function UrlEncode(str){
  var ret="";
  var strSpecial="!\"#$%&'()*+,/:;<=>?[]^`{|}~%";
  var tt= "";

  for(var i=0;i<str.length;i++){
   var chr = str.charAt(i);
    var c=str2asc(chr);
    tt += chr+":"+c+"n";
    if(parseInt("0x"+c) > 0x7f){
      ret+="%"+c.slice(0,2)+"%"+c.slice(-2);
    }else{
      if(chr==" ")
        ret+="+";
      else if(strSpecial.indexOf(chr)!=-1)
        ret+="%"+c.toString(16);
      else
        ret+=chr;
    }
  }
  return ret;
}
function UrlDecode(str){
  var ret="";
  for(var i=0;i<str.length;i++){
   var chr = str.charAt(i);
    if(chr == "+"){
      ret+=" ";
    }else if(chr=="%"){
     var asc = str.substring(i+1,i+3);
     if(parseInt("0x"+asc)>0x7f){
      ret+=asc2str(parseInt("0x"+asc+str.substring(i+4,i+6)));
      i+=5;
     }else{
      ret+=asc2str(parseInt("0x"+asc));
      i+=2;
     }
    }else{
      ret+= chr;
    }
  }
  return ret;
}
//这个方法现在只用于静态方法，其他方法的检查以后




function isOnSubmit() {
	if (document.form_static.j_username.value == '') {
		alert("<spring:message text='用户名称不能为空' code='loginjsp_label1' />");
		document.form_static.j_username.focus();
		return false;
	}
	if (document.form_static.j_password.value == '') {
		alert("<spring:message text='用户密码不能为空' code='loginjsp_label2' />");
		document.form_static.j_password.focus();
		return false;
	}
	<% if (!"true".equals(Constants.EAS)) { %>
	if (isChinese(document.form_static.j_username.value)) {
		document.form_static.j_username.value = UrlEncode(document.form_static.j_username.value);
	}
	<% } %>
	return true;
}

function dyOnSubmit(){
	<% if (!"true".equals(Constants.EAS)) { %>
	if (isChinese(document.form_dynamic.j_username.value)) {
		document.form_dynamic.j_username.value = UrlEncode(document.form_dynamic.j_username.value);
	}
	<% } %>
	return true;
}

function isChinese(s){
	var ret = false;
	//for(var i=0;i<s.length;i++) {
	//	if(s.charCodeAt(i)>=10000)
	//	return true;
	//}
	return ret;
}
</script>
<script language='javascript' type="text/javascript">
function efocus(event) {
	var elem = Event.element(event);
	elem.style.border = '1 solid #ffb742';
}

function eblur(event) {
	var elem = Event.element(event);
	elem.style.border = '1px solid #666666';
}

function ekeydown(event) {
	if (event.keyCode == Event.KEY_RETURN)
		event.keyCode = Event.KEY_TAB;
}

function changeMode(obj) {
	//将选择的结果存入cookie，在验证返回后到相应的页

	//并且记录用户上次使用方式

	document.getElementById('login_static').style.display='none';
	<% if ("true".equals(Constants.DYNAMIC)) { %>
		document.getElementById('login_dynamic').style.display='none';
	<% } %>
	<% if ("true".equals(Constants.RTX)) { %>
		document.getElementById('login_rtx').style.display='none';
	<% } %>
	<%-- PT056407, R111009-0403, hao_yun, 将v6.2R1中的IM集成回迁至v6.1 --%>
	<% if ("true".equals(Constants.UCSTAR)) { %>
		document.getElementById('login_ucstar').style.display='none';
	<% } %>
	document.getElementById('login_'+obj.value).style.display="inline";
	//如果是rtx集成，则需要进行调用自动登

	<% if ("true".equals(Constants.RTX)) { %>
		if (obj.value == 'rtx') {
			document.all.loginRtxButton.click();
		}
	<% } %>
	<%-- PT056407, R111009-0403, hao_yun, 将v6.2R1中的IM集成回迁至v6.1 --%>
	<% if ("true".equals(Constants.UCSTAR)) { %>
		if (obj.value == 'ucstar') {
			document.all.loginUcstarButton.click();
		}
	<% } %>
	var varselect = document.getElementsByName("selectLoginType");
	var index=0;
	if(obj.value=='static')
	  index=0;
	  if(obj.value=='dynamic')
	  index=1;
	  var i=0;

for (i=0;i<varselect.length;i++){
		varselect[i].options(index).selected=true;
	}

}
</script>
<script language='javascript' type="text/javascript">
function showLoginMessage(){
<c:if test="${not empty param.login_error}">
	<c:if test="${param.login_error == 'code_error'}">
		alert('${login_error_code_error}');
	</c:if>
	<c:if test="${param.login_error == '1'}">
		alert('${login_error_1}');
	</c:if>
	<c:if test="${param.login_error == '2'}">
		alert('${login_error_2}');
	</c:if>
	<c:if test="${param.login_error == '3'}">
		alert('${login_error_3}');
	</c:if>
	<c:if test="${param.login_error == '4'}">
		alert('${login_error_4}');
	</c:if>
	<c:if test="${param.login_error == '5'}">
		alert('${login_error_5}');
	</c:if>
	<c:if test="${param.login_error == '6'}">
		alert("<spring:message text='License已过期' code='loginjsp_label15' />");
	</c:if>
	<c:if test="${param.login_error == '7'}">
		alert("${login_error_7}");
	</c:if>
	<c:if test="${param.login_error == '8'}">
		alert("${login_error_8}");
	</c:if>
	<c:if test="${param.login_error == '9'}">
		alert("${login_error_9}");
	</c:if>
</c:if>
}
	<c:set var="url" value="${pageContext.request.contextPath}/components/oahelper/office_addin.msi" />
	function checkOfficeAddIn() {
		if ( !window.ActiveXObject ) return;
		var installed = false;
		var needUpdate = false;
		var newVersion = "<%=Constants.OFFICE_ADDIN_VERSION%>";
		try {
			var o = new ActiveXObject("OAHelperOfficeAddIn.Detector");
			installed = o.IsInstalled();
			var v = o.GetVersion();
			needUpdate = v < newVersion;
		} catch ( exception ) {
		}
		if ( installed !== true ) {
			$("msgOffice").innerHTML = '<spring:message code="loginjsp_label16" arguments="${url}" />';
		}
		if ( needUpdate === true ) {
			$("msgOffice").innerHTML = '<spring:message code="loginjsp_label19" arguments="${url}" />';
		}
	}
	
	//dexiang_lei 2012-3-22 清除导航的cookie 
	function deleteHeaderTabCookie() {
		if(Get_Cookie("leftMoveTimeCount") != null) {
			Delete_Cookie("leftMoveTimeCount",'/','');
		}
		if(Get_Cookie("rightMoveTimeCount") != null) {
			Delete_Cookie("rightMoveTimeCount",'/','');
		}
	}
</script>
</head>
<%
	if(request.getLocale().toString().toLowerCase().startsWith("en")){%>
		<c:set var="languages" value="english" />
	<%
	}else if(request.getLocale().toString().equalsIgnoreCase("zh_hk") || request.getLocale().toString().equalsIgnoreCase("zh_tw") || request.getLocale().toString().equalsIgnoreCase("zh_mo")){
	%>
		<c:set var="languages" value="complexChinese" />
	<%
	}else{
	%>
		<c:set var="languages" value="simpleChinese" />
	<%
	}
%>

<body id="login" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onload="showLoginMessage();checkOfficeAddIn();">

<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td align="center" valign="middle" class="header_background"><table width="100%" height="66" border="0" align="center" cellpadding="0" cellspacing="0" >
      <tr>
        <td width="50%" valign="bottom" style="padding-left:25px;"><div class="login-logo"></div></td>
        <td width="24%" align="right" valign="bottom" style="padding-right:25px; padding-bottom:3px;"><div id="msgOffice">&nbsp;</div></td>
        <td width="26%" align="right" valign="bottom" style="padding-right:25px"><table>
  <td style="padding-bottom:4px"><c:if test="${languages==null || languages=='simpleChinese'}"> <a href="javascript:void(0);" class="font_fff"  onClick="javascript:window.open('<c:url value="/help/client.jsp"/>');">
              <spring:message text='客户端环境要求' code='loginjsp_label3' />
              </a>&nbsp;&nbsp;&nbsp;&nbsp;</c:if>
          <c:if test="${languages!=null && languages=='complexChinese'}"> <a href="javascript:void(0);" class="font_fff"  onClick="javascript:window.open('<c:url value="/help/client_zh_HK.jsp"/>');">
              <spring:message text='客户端环境要求' code='loginjsp_label3' />
              </a>&nbsp;&nbsp;&nbsp;&nbsp;</c:if>
          <c:if test="${languages!=null && languages=='english'}"> <a href="javascript:void(0);" onClick="javascript:window.open('<c:url value="/help/client_en.jsp"/>');">
              <spring:message text='客户端环境要求' code='loginjsp_label3' />
              </a>&nbsp;&nbsp;&nbsp;&nbsp;</c:if></td>
        </table></td>
      </tr>
    </table>


      <table cellpadding="0" cellspacing="0"  width="100%" height="100%">
      <tr>
        <td height="37px">
		<DIV id="loginHead">
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
		  <tr>
			<td height="37" ></td>
			</tr>
		</table>
</DIV>		</td>
      </tr>
      <tr>
        <td align="center" valign="middle" style="padding-bottom:0px"><DIV id="login_static" style="display:inline">
            <% if ("true".equals(Constants.EAS)) { %>
            <form name="form_static" method="post" action='<c:url value="/login/kingdee_sso_auth.jsp" />' onsubmit="return isOnSubmit();">
            <% } else { %>
            <form name="form_static" method="post" action='<c:url value="/j_acegi_security_check" />' onSubmit="return isOnSubmit();">
              <% } %>
              <input id="j_mode" type="hidden" name="j_mode" value="static">
              <table width="820" border="0" align="center" cellpadding="0" cellspacing="0" >
                <tr>
                  <td height="170" align="right" valign="top" style="padding:30 0 0 0px"><table width="280" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td height="30">语&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;言:</td>
                      <td height="30">
                      <c:set var="clientlanguage">${cookie['clientlanguage'].value}</c:set>
					  <c:if test="${cookie['clientlanguage'].value==null || cookie['clientlanguage'].value==''}">
                      	<c:set var="clientlanguage"><%=request.getLocale().toString()%></c:set>
                      </c:if>
                      <select name="j_locale" style="width:120px" onChange="changeL(this.value)">
                          <option value="zh_CN">1简体</option>
                          <option value="zh_HK"


                        <c:if test="${clientlanguage == 'zh_HK'}">selected</c:if>
                          >繁體


                        </option>
                          <%if(ContextUtils.getInterfaceLicense("lang_en")){ %>
                          <option value="en_US"

                        <c:if test="${ clientlanguage == 'en_US'}">selected</c:if>
                          >English


                        </option>
                          <%} %>
                          
                          
                          
                        </select>
                      </td>
                      <td height="30">&nbsp;</td>
                    </tr>
		    <%-- PT056407, R111009-0403, hao_yun, 将v6.2R1中的IM集成回迁至v6.1 --%>
                    <% if ("true".equals(Constants.DYNAMIC) || "true".equals(Constants.RTX) || "true".equals(Constants.UCSTAR)) { %>
                    <tr>
                      <td width="16%" height="30">验证方式:</td>
                      <td width="30%" height="30">
                      <select onChange="changeMode(this);"  name="selectLoginType"  style="width:120px">
                           <option value="static"><spring:message text='系统密码' code='loginjsp_label5'/></option>
                            <%if(ContextUtils.getInterfaceLicense("dynamic")&&"true".equals(Constants.DYNAMIC)) { %>
                            <option value="dynamic" ><spring:message text='动态密码' code='loginjsp_label6'/></option>
                            <%}%>
                            <%if("true".equals(Constants.RTX)) { %>
                            <option value="rtx"><spring:message text='RTX登录' code='loginjsp_label7'/></option>
                            <%}%>
                            <%if( ContextUtils.getInterfaceLicense("im")&&"true".equals(Constants.UCSTAR) ) { %>
                            <option value="ucstar"><spring:message text="UcSTAR集成" code="loginjsp_label17"/></option>
                            <%}%>
                        </select>
                      </td>
                      <td width="19%" height="30">&nbsp;</td>
                    </tr>
                    <%} %>
                    <tr>
                      <td width="16%" height="30">${login_username}</td>
                      <td width="30%" height="30"><input name="j_username" type="text" size="15" style="width:120px"
          	onfocus="efocus(event);" onBlur="eblur(event);" onKeyDown="ekeydown(event)" maxlength="50" /></td>
                      <td width="19%" height="30">&nbsp;</td>
                    </tr>
                    <tr>
                      <td height="30">${login_password}</td>
                      <td height="30"><input name="j_password" type="password" size="15" style="width:120px"
          	onfocus="efocus(event);" onBlur="eblur(event);"  <%if(Constants.IMAGERAND){%> onKeyDown="ekeydown(event)" <%} %>  maxlength="25" /></td>
                      <td height="30">&nbsp;</td>
                    </tr>
                    <%if(Constants.IMAGERAND){%>
                    <tr>
                      <td height="30">${login_j_captcha_response}</td>
                      <td height="30"><input name="j_captcha_response" type="text" size="15" style="width:120px"
          	onfocus="efocus(event);" onBlur="eblur(event);" maxlength="4" /></td>
                      <td height="30"><img src="<c:url value="/common/image.jpg" />"></td>
                    </tr>
                    <%} %>
                    <tr align="center">
                      <td height="30" colspan="3" align="left" valign="bottom" style="padding-left:20px"><input type="submit" name="Submit3" onclick="deleteHeaderTabCookie();" value="${login_submit}"
        	class="button"
        	onmouseover="this.className='buttonOver'"
        	onmousedown="this.className='buttonDown'"
        	onmouseout="this.className='button'" />
                        &nbsp;&nbsp;
                        <input type="reset" name="Submit2" value="${login_reset}"
	      	class="button"
        	onmouseover="this.className='buttonOver'"
        	onmousedown="this.className='buttonDown'"
        	onmouseout="this.className='button'" />
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </td>
                    </tr>
                  </table></td>
                </tr>
                <%-- 
                <tr>
                  <td height="100" align="center" valign="bottom"><table width="100%" style="padding-bottom:10px">
                      <tr>
                        <td align="center" class="font_fff">Kingdee Software(China) Co., Ltd. © 1993-2011 kingdee.com All Rights Reserved.</td>
                        </tr>
                  </table></td>
                </tr>
                --%>
              </table>
            </form>
        </DIV>
            <% if ("true".equals(Constants.DYNAMIC)) { %>
            <DIV id="login_dynamic" style="display:none">
              <form name="form_dynamic" method="post" action='<c:url value="/j_acegi_security_check" />' onSubmit="return dyOnSubmit();">
                <input id="j_mode" type="hidden" name="j_mode" value="dynamic">
                <table width="1022" height="325" border="0" align="center" cellpadding="0" cellspacing="0">
                  <tr>
                    <td width="607" align="right" valign="top" background="images/login_bgl.png"><table width="100%" height="316">
                        <tr>
                          <td height="276" align="left" valign="top">&nbsp;</td>
                        </tr>
                        <tr>
                        </tr>
                    </table></td>
                    <td width="415" valign="top" background="images/login_bgr.png"><table width="98%" height="316">
                        <tr>
                          <td height="40px"><table  style="margin:46 0 0 160px">
                            <td align="right" valign="top"><a href="javascript:void(0);" onClick="javascript:window.open('<c:url value="/help/client_en.jsp"/>');"><font color="#99cbea">
                             
                            </font></a>&nbsp;&nbsp;&nbsp;&nbsp;</td>
                                  </table></td>
                        </tr>
                        <tr>
                          <td height="140" align="left" valign="top"><table width="300" border="0" cellspacing="0" cellpadding="0" style="margin:20 0 0 14px">
                              <% if ("true".equals(Constants.DYNAMIC) || "true".equals(Constants.RTX)) { %>
                              <tr>
                                <td width="16%" height="30">验证方式:</td>
                                <td width="30%" height="30"><select onChange="changeMode(this);"  name="selectLoginType"  style="width:120px">
                                    <option value="static">&nbsp;
                                    <spring:message text='系统密码' code='loginjsp_label5' />
                                      &nbsp;&nbsp;&nbsp;</option>
                                    <% if ("true".equals(Constants.DYNAMIC)) { %>
                                    <option value="dynamic" >&nbsp;
                                    <spring:message text='动态密码' code='loginjsp_label6' />
                                      &nbsp;&nbsp;&nbsp;</option>
                                    <%} %>
                                    <% if ("true".equals(Constants.RTX)) { %>
                                    <option value="rtx">&nbsp;
                                    <spring:message text='RTX登录' code='loginjsp_label7' />
                                      &nbsp;&nbsp;&nbsp;</option>
                                    <%} %>
                                    <%-- PT056407, R111009-0403, hao_yun, 将v6.2R1中的IM集成回迁至v6.1 --%>
                                    <% if ( "true".equals(Constants.UCSTAR) ) { %>
                                    <option value="ucstar">&nbsp;
                                    <spring:message text="UcSTAR集成" code="loginjsp_label17" />
                                      &nbsp;&nbsp;&nbsp;</option>
                                    <% } %>
                                  </select>
                                </td>
                                <td width="19%" height="30">&nbsp;</td>
                              </tr>
                              <%} %>
                              <tr>
                                <td width="16%" height="30">${login_username}</td>
                                <td width="30%" height="30"><input name="j_username" type="text" size="15" style="width:120px"
          	onfocus="efocus(event);" onBlur="eblur(event);" onKeyDown="ekeydown(event)" maxlength="50" /></td>
                                <td width="19%" height="30">&nbsp;</td>
                              </tr>
                              <tr>
                                <td height="30">${login_password}</td>
                                <td height="30"><input name="j_password" type="text" size="15" style="width:120px"
          	onfocus="efocus(event);" onBlur="eblur(event);"  maxlength="25" /></td>
                                <td height="30">&nbsp;</td>
                              </tr>
                              <tr align="center">
                                <td height="30" colspan="3" valign="bottom">&nbsp;</td>
                              </tr>
                              <tr align="center">
                                <td height="30" colspan="3" valign="bottom"><input type="submit" name="Submit" value="${login_submit}"
        	class="button"
        	onmouseover="this.className='buttonOver'"
        	onmousedown="this.className='buttonDown'"
        	onmouseout="this.className='button'" />
                                  &nbsp;&nbsp;
                                  <input type="reset" name="Submit2" value="${login_reset}"
        	class="button"
        	onmouseover="this.className='buttonOver'"
        	onmousedown="this.className='buttonDown'"
        	onmouseout="this.className='button'" />
                                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </td>
                              </tr>
                          </table></td>
                        </tr>
                        <tr>
                        </tr>
                    </table></td>
                  </tr>
                </table>
              </form>
            </DIV>
          <% } %>
            <% if ("true".equals(Constants.RTX)) { %>
            <DIV id="login_rtx" style="display:none">
              <script language="vbscript" id="clientEventHandlersVBS">
<!--
Function loginRtx()
	on error resume next
	'<spring:message text='得到帐号' code='loginjsp_label8' />
	Set objKernal = RTXAX.GetObject("KernalRoot")
	Account = objKernal.Account

	set objSign = objKernal.Sign

	If Account = "" Then
	   MsgBox "<spring:message text='您未登录RTX，请先登录到RTX' code='loginjsp_label9' />！"
	Else
		'MsgBox "<spring:message text='当前用户' code='loginjsp_label10' />：" & Account
		'MsgBox "<spring:message text='数字证书' code='loginjsp_label11' />：" & objSign.GetString("Sign")
		'<spring:message text='开始提交表单' code='loginjsp_label12' />

		If isChinese(Account) Then
			Account = UrlEncode(Account)
		End If


		form_rtx.j_username.value = Account
		'<spring:message text='暂时不要用RTX的签名，因为跨平台验证还不能实现' code='loginjsp_label13' />
		'form_rtx.j_password.value = objSign.GetString("Sign")
		form_rtx.submit
	End If
End Function
-->
      </script>
              <OBJECT id=RTXAX
data=data:application/x-oleobject;base64,fajuXg4WLUqEJ7bDM/7aTQADAAAaAAAAGgAAAA==
classid=clsid:5EEEA87D-160E-4A2D-8427-B6C333FEDA4D VIEWASTEXT>
              </OBJECT>
              <form name="form_rtx" id="form_rtx" method="post" action='<c:url value="/j_acegi_security_check" />'>
                <input id="j_mode" type="hidden" name="j_mode" value="rtx">
                <input id="j_username" name="j_username" type="hidden" value="">
                <input id="j_password" name="j_password" type="hidden" value="<%=session.getId()%>">
                <table width="1022" height="325" border="0" align="center" cellpadding="0" cellspacing="0" >
                  <tr>
                    <td width="607" align="right" valign="top" background="images/login_bgl.png"><table width="100%" height="316">
                        <tr>
                          <td height="276" align="left" valign="top">&nbsp;</td>
                        </tr>
                        <tr>
                          <td height="30" align="right">&nbsp;</td>
                        </tr>
                    </table></td>
                    <td width="415" valign="top" background="images/login_bgr.png"><table width="98%" height="316">
                        <tr>
                          <td height="276" align="left" valign="top"><table width="280" border="0" cellspacing="0" cellpadding="0" style="margin:110 0 0 14px">
                              <tr>
                                <td height="90" colspan="3"><spring:message text='如果您的计算机已经成功登录了RTX，OA系统会自动登录到，如果您看到此信息，可能您没有正确登录RTX，请先登录RTX，然后点[登录]按钮。' code='loginjsp_label14' /></td>
                              </tr>
                              <tr align="center">
                                <td height="10" colspan="3" valign="bottom">&nbsp;</td>
                              </tr>
                              <tr align="center">
                                <td height="30" colspan="3" valign="bottom"><input type="button" name="loginRtxButton" id="loginRtxButton" value="${login_submit}" class="button" onClick="loginRtx()" />
                                </td>
                              </tr>
                          </table></td>
                        </tr>
                        <tr>
                          <td height="30" align="left" style="padding-left:10px">&nbsp;</td>
                        </tr>
                    </table></td>
                  </tr>
                </table>
              </form>
            </DIV>
          <% } %>
	  <%-- PT056407, R111009-0403, hao_yun, 将v6.2R1中的IM集成回迁至v6.1 --%>
          <% if ("true".equals(Constants.UCSTAR)) { %>
            <DIV id="login_ucstar" style="display:none">
	<script language="javascript" >
	function loginByUcstar() {
		var o = isUcstarOnline();
		if ( !o.isOnline ) {
			alert("您未登录UCSTAR，请先登录到UCSTAR");
			return false;
		}
		
		try {
			var name = uc_objectCtrl.GetLoginName();
		//	alert("GetLoginName=" + name);
			if ( typeof(name) == "string" && name != "" ) {
				form_ucstar.j_username.value = name;
				form_ucstar.submit();
			} else {
				alert("您未登录UCSTAR，请先登录到UCSTAR");
				return false;
			}
		} catch ( ex ) {
			alert("发生异常：" + ex.message);
			return false;
		}
		return true;
	}
	
	try {
		uc_registerWinOnload();
	} catch ( ex ) {
	}
      </script>
              <form name="form_ucstar" id="form_ucstar" method="post" action='<c:url value="/j_acegi_security_check" />'>
                <input id="j_mode" type="hidden" name="j_mode" value="ucstar">
                <input id="j_username" name="j_username" type="hidden" value="">
                <input id="j_password" name="j_password" type="hidden" value="<%=session.getId()%>">
                <table width="1022" height="325" border="0" align="center" cellpadding="0" cellspacing="0" >
                  <tr>
                    <td width="607" align="right" valign="top" background="images/login_bgl.png"><table width="100%" height="316">
                        <tr>
                          <td height="276" align="left" valign="top">&nbsp;</td>
                        </tr>
                        <tr>
                          <td height="30" align="right">&nbsp;</td>
                        </tr>
                    </table></td>
                    <td width="415" valign="top" background="images/login_bgr.png"><table width="98%" height="316">
                        <tr>
                          <td height="276" align="left" valign="top"><table width="280" border="0" cellspacing="0" cellpadding="0" style="margin:110 0 0 14px">
                              <tr>
                                <td height="90" colspan="3"><spring:message text="如果您的计算机已经成功登录了UcSTAR，OA系统会自动登录到。如果您看到此信息，可能您没有正确登录UcSTAR。请先登录UcSTAR，然后点[登录]按钮。" code="loginjsp_label18" /></td>
                              </tr>
                              <tr align="center">
                                <td height="10" colspan="3" valign="bottom">&nbsp;</td>
                              </tr>
                              <tr align="center">
                                <td height="30" colspan="3" valign="bottom">
                                	<input type="button" name="loginUcstarButton" id="loginUcstarButton" value="${login_submit}" class="button" onClick="loginByUcstar()" />
                                	
                                	<%-- added by hao_yun, 2011-09-20 --%>
                                	<c:set var="url_home"><c:url value="/" /></c:set>
                                	<input type="button" value="<spring:message text='&nbsp;返&nbsp;&nbsp;回&nbsp' code='common_return2' />" class="button" onclick="javascript:window.location.href='${url_home}';return false;" />
                                </td>
                              </tr>
                          </table></td>
                        </tr>
                        <tr>
                          <td height="30" align="left" style="padding-left:10px">&nbsp;</td>
                        </tr>
                    </table></td>
                  </tr>
                </table>
              </form>
            </DIV>
          <% } %>
        </td>
      </tr>
       <tr>
            <td align="center" class="font_fff">Kingdee Software(China) Co., Ltd. © 1993-2011 kingdee.com All Rights Reserved.</td>
      </tr>
      <tr>
        <td height="80" valign="bottom"><DIV id="loginFoot"></DIV></td>
      </tr>
    </table></td>
  </tr>
</table>
</body>
</html>
<script language="javascript">
<% if (!"0".equals(Constants.LOGIN_COOKIE)) { %>
<%
Cookie[] cookies = request.getCookies();
Cookie temp = null;
String loginId="";
//增加非空判断 hua_zhang 2011-12-2 代小飞修改

if(cookies!=null){
for(int i = 0;i < cookies.length; i++){
	temp = cookies[i];
	if(temp.getName().equals("loginId"))
		loginId = java.net.URLDecoder.decode(temp.getValue(),"UTF-8");
}
}
%>
var cookie_loginid = '<%=loginId%>';

if (cookie_loginid == null) cookie_loginid = '';
var cookie_authmode = Get_Cookie("authMode");
if (cookie_authmode == null) cookie_authmode = 'static';
if (cookie_authmode == 'dynamic') {
	<% if ("true".equals(Constants.DYNAMIC)) { %>
		document.getElementById('j_mode_dynamic').click();
		document.form_dynamic.j_username.value = cookie_loginid;
	<% } %>
} else {
	if (cookie_authmode == 'rtx') {
		<% if ("true".equals(Constants.RTX)) { %>
		document.getElementById('j_mode_rtx').click();
		<% } %>
	} else if (cookie_authmode == 'ucstar') {
		<%-- PT056407, R111009-0403, hao_yun, 将v6.2R1中的IM集成回迁至v6.1 --%>
		<% if ("true".equals(Constants.UCSTAR)) { %>
		document.getElementById('j_mode_ucstar').click();
		<% } %>
	} else {
		<% if ("true".equals(Constants.DYNAMIC) || "true".equals(Constants.RTX) || "true".equals(Constants.UCSTAR)) { %>
			document.getElementById('j_mode_static').click();
		<% } %>
		document.form_static.j_username.value = cookie_loginid;
	}
}
<% } %>

Set_Cookie('userClose','0','','/','','');

function changeL(locale){
	Set_Cookie('clientlanguage',locale,'365','/','','');
}

</script>
